function arrToObj(arr){
    let obj = {};
    for(let item of arr){
        item = item.split(':');
        obj[item[0]] = item[1];
    }
        return obj;
}

function getToObj(input){
    let str = input.toString();
    let studentArr = str.split(',');
    let studentObj ={};
    studentObj.name = studentArr[0];
    studentObj.id = studentArr[1];
    studentObj.score = arrToObj(studentArr.slice(4)); 
    console.log(studentObj);
    return studentObj;
}

module.exports = arrToObj;
module.exports = getToObj;